<html>
<head>
    <script type="text/javascript" >
     var head=document.getElementsByTagName('head')[0]
        var link=document.createElement("link")
        link.rel="stylesheet"
        if(isMobile())
        {
            link.href="../../static/style/phone-edite.css"
        }
        else
        {
            link.href="../../static/style/edite.css"
            // link.href="../../static/style/phone-edite.css"

        }
        head.appendChild(link)
        function isMobile() 
         {
           const regExp = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|OpenHarmony/i;
           return regExp.test(navigator.userAgent);
         }
     </script>
 <title>编辑器</title>
 <link rel="icon" href="../../static/logo/index.png"  type="image/x-icon">
 <script type="text/javascript" src="../../static/js/jquery.js"></script>
 <script type="text/javascript" src="../../static/js/edite.js"></script>
 <!-- 解决乱码和图片跨域问题 -->
 <meta charset="utf8" name="referrer" content="no-referrer">
 <!-- <meta http-equiv="refresh" content="3"> -->
 <meta  />
</head>
 <body>
  <div id="container">
   <div id="status">状态</div>
   <div id="toolBox">
    <div id="homeBox">
     <a href="/" id="home">导航</a>
     <a  href="log.php" id="log">记录</a>
     <a   href="edite.php?subEd=no" id="enter">导入</a>
    </div>
    
    <div id="toCenter">
     <button class="toolButton" id="undo">撤销</button>
     <button class="toolButton" id="redo">前进</button>
     <button class="toolButton" id="bold">加粗</button>
     <button class="toolButton" id="italic">斜体</button>
     <button class="toolButton" id="underline">下划线</button>
     <button class="toolButton" id="strikeThrough">贯穿线</button>
     <button class="toolButton" >
      <span id="fonteColor1">前景色</span>
      <span id="showColor1" class="showColor"></span>
     </button>
     <button class="toolButton" >
      <span id="backgroundColor">背景色</span>
      <span id="showColor2" class="showColor"></span>
     </button>
     <button class="toolButton" id="fontSize">字号</button>
     <button class="toolButton" id="lineHeight">行距</button>
     <button class="toolButton" id="foneWidth">字距</button>
     <button class="toolButton" id="justifyLeft">左对齐</button>
     <button class="toolButton" id="justifyCenter">居中</button>
     <button class="toolButton" id="justifyRight">右对齐</button>
     <button class="toolButton" id="justifyFull">端对齐</button>
     <button class="toolButton" id="cpFormat">格式刷</button>
     <button class="toolButton" id="insertTable">插入表格</button>
     <button class="toolButton" id="insertImg">插图</button>
     <button class="toolButton" id="html">html</button>
     <button class="toolButton" id="save">保存</button>
     <button class="toolButton" id="dele" onclick="deleTable()">删表</button>
     <span  class="toolButton" id="clsBox">类型:<input type="text" id="cls"></span> 
     
    </div>
   </div>
   <div id="popBox">
    <div id="fonteColorBox">
     <input type="color" id="getColor1" value="#ffff00">
    </div>
    <div id="backgroundColorBox">
     <input type="color" id="getColor2" value="#FF0000">
    </div>
      
    <div id="fontSizeBox">
         <input type="text" id="fontSizeValue" value="26">
         <button id="fontSizeYese">确定</button>
    </div>

   
    <div id='insertTableBox'>
     <input type="text" id="hang" value=3>
     <input type="text" id="lie"  value=3>
     <span>行数</span><span>列数</span>
     <button id="insertTableYes">确定</button>
     <button id="insertTableCancel">取消</button>
    </div>
   
    
    <div id="showImgBox">
     <div id="showImg">
      <input type="file" id="file">
      <img src="../../datas/img/showImg.jpg" alt="">
      <video src="" controls></video>
      <a href=""></a>
     </div>
     <div id="imgButtonBox">
      <button id="selectionButton">选择</button>
      <button id="yesButton">确定</button>
      <button id="cancelButton">取消</button>
     </div>
    </div>

    <div id="changeTable">
     <div id="hanglie">
      <input type="text" placeholder="添加行列数" id="addHLip" value="2">
      <button id="preAddButton">前添加</button>
      <button id="hdAddButton">后添加</button>
     </div>
     <div id="setWH">
      <input type="text" placeholder="设定宽高度" id="setWHip">
      <button id="tableDele">删除</button>
      <button id="sizeY">确定</button>
      <button id="tbEditCancel">关闭</button>
     </div>
    </div>

    <div id="lineHeightBox" style="top:50px;display: none;">
        <span class="boxTips">行高</span>
        <button class="lineHeightValue">0.1em</button>
        <button class="lineHeightValue">0.2em</button>
        <button class="lineHeightValue">0.3em</button>
        <button class="lineHeightValue">0.5em</button>
        <button class="lineHeightValue">0.8m</button>
        <button class="lineHeightValue">0.9em</button>
        <button class="lineHeightValue">1em</button>
        <button class="lineHeightValue">1.2em</button>
        <button class="lineHeightValue">1.5em</button>
        <button class="lineHeightValue">1.6em</button>
        <button class="lineHeightValue">1.8em</button>
        <button class="lineHeightValue">2em</button>
        <button class="lineHeightValue">2.3em</button>
        <button class="lineHeightValue">2.5em</button>
        <button class="lineHeightValue">2.8em</button>
        <button class="lineHeightValue">3em</button>
        <button class="lineHeightValue">3.5em</button>
        
    </div>
     <div id="foneWidthBox" style="top:50px;display: none;">
        <span class="boxTips">字距</span>
        <button class="foneWidthValue">0.1em</button>
        <button class="foneWidthValue">0.2em</button>
        <button class="foneWidthValue">0.3em</button>
        <button class="foneWidthValue">0.5em</button>
        <button class="foneWidthValue">0.8m</button>
        <button class="foneWidthValue">0.9em</button>
        <button class="foneWidthValue">1em</button>
        <button class="foneWidthValue">1.2em</button>
        <button class="foneWidthValue">1.5em</button>
        <button class="foneWidthValue">1.6em</button>
        <button class="foneWidthValue">1.8em</button>
        <button class="foneWidthValue">2em</button>
        <button class="foneWidthValue">2.3em</button>
        <button class="foneWidthValue">2.5em</button>
        <button class="foneWidthValue">2.8em</button>
        <button class="foneWidthValue">3em</button>
        <button class="foneWidthValue">3.5em</button>
        
    </div>
   </div>
   <?php
          $oldCls=$_GET["cls"];
          $oldTitle=$_GET["title"];
          $subEd=$_GET["subEd"] ;
          $contents="<p><br></p>";
          if(strlen($subEd)==0)
          {
              $subEd="no";
          }
          if(strlen($oldCls)!=0 && strlen($oldTitle)!=0)
          {

           $fileName="../../datas/txt/".$oldCls."#-#".$oldTitle.".txt";
           $file=fopen($fileName, "r");
           $contents=fread($file,filesize($fileName));
          }

          echo "<input type='text' style='display:none;'  id='oldCls' value=$oldCls>";
          echo "<input type='text' style='display:none;'  id='oldTitle' value=$oldTitle>";
          echo "<input type='text' style='display:none;'  id='contents' value='".htmlspecialchars($contents,ENT_QUOTES)."'>";

          echo "<input type='text' style='display:none;'  id='subEd' value=$subEd>";
         ?>
   <div  id="textArea" contenteditable="true" spellcheck="false">
   </div>
   <div id="footer">
   <footer>
            <p>隐私保护　TH公司　版权所有　京ICP证000007</p>
            <p>违法和不良信息举报电话：xxxx　举报邮箱：1132224184@qq.com</p>
            <p>京网文【2017】10231-1151号　互联网新闻信息服务许可编号：11220180001 </p>
            <p>北京新浪互联信息服务有限公司</p>
            <p>互联网药品信息服务（京）-经营性-2019-0026　京教研[2002]7号　电信业务审批[2001]字第379号</p>
            <p>增值电信业务经营许可证B1.B2-20090108　电信与信息服务业务许可编号：京ICP证000007号</p>
            <p>广播电视节目制作经营许可证（京）字第828号 甲测资字1100078 京公网安备11000002000016号</p>
        </footer>
   </div>
  </div>
 </body>
</html>